Skip to content

Fixed error in infix2prefix file #4006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

maldz3
Copy link
Contributor

@maldz3 maldz3 commented Dec 3, 2020

Describe your change:

Using parentheses in a test caused the algorithm to fail, I added a check to remove the keystroke error. I also changed all uppercase variables to lowercase as per the coding style.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@ghost ghost added the awaiting reviews This PR is ready to be reviewed label Dec 3, 2020
@ghost
Copy link

ghost commented Dec 3, 2020

Pull Request Report

@maldz3 Hello! I'm a bot made to check all the pull request Python files. First of all, I want to say thank you for your time and interest in this project and for opening a pull request. There seems to be missing requirements in some of the Python files submitted in this pull request. Please read through the report and make the necessary changes. You can take a look at the relevant links provided after the report.

What are node paths? 🔽

The report contains headings and a checklist where the items are paths to the class/function/parameter where the requirement is missing. Node paths are double colon :: separated names and can be in any of the following format:

  • Class path: [file_name]::[class_name]
  • Function path: [file_name]::[function_name]
  • Function parameter path: [file_name]::[function_name]::[parameter_name]
  • Method path: [file_name]::[class_name]::[function_name]
  • Method parameter path: [file_name]::[class_name]::[function_name]::[parameter_name]

Following functions require tests [doctest/unittest/pytest]:

  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_postfix
  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_prefix

Following functions require return type hints:

NOTE: If the function returns None then provide the type hint as def function() -> None

  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_postfix
  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_prefix

Following function parameters require type hints:

  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_postfix::infix
  • data_structures/stacks/infix_to_prefix_conversion.py::infix_2_prefix::infix
Relevant links 🔽

@ghost ghost added require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html and removed awaiting reviews This PR is ready to be reviewed labels Dec 3, 2020
@maldz3
Copy link
Contributor Author

maldz3 commented Dec 3, 2020

There are many other changes that need to be made here, no doctests, print statements in functions, no type hints. I just fixed the error, and changed the variables names to lowercase.

@maldz3 maldz3 changed the title Maliha infix2prefix error Fixed error in infix2prefix file Dec 3, 2020
@dhruvmanila
Copy link
Member

If possible, can you provide doctests, type hints for the functions? If not, then it's fine.

@dhruvmanila dhruvmanila reopened this Dec 24, 2020
@ghost ghost added enhancement This PR modified some existing files merge conflicts Open a new PR or rebase on the latest commit and removed require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Dec 24, 2020
@maldz3
Copy link
Contributor Author

maldz3 commented Jan 2, 2021

Adding doctests is a little more complicated for this code since they have print statements throughout the main functions. The table printing could either be removed completely, or perhaps be put into its own function.

@stale
Copy link

stale bot commented Feb 2, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Feb 2, 2021
@stale
Copy link

stale bot commented Feb 13, 2021

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files merge conflicts Open a new PR or rebase on the latest commit stale Used to mark an issue or pull request stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants